﻿namespace iFinance.Infrastructure.ViewModels
{
    using iFinance.Entity;
    using Microsoft.Practices.Prism.ViewModel;

    /// <summary>
    /// 支出类型ViewModel
    /// </summary>
    public class OutgoingsTypeViewModel : NotificationObject
    {
        #region Ctor

        public OutgoingsTypeViewModel()
        {
            //TODO TestData
            List.Add(new OutgoingsTypeItemViewModel(
                new OutgoingsType 
                {
                    ID = 1,
                    ParentID = 1,
                    Name = "餐饮"
                }));

            List.Add(new OutgoingsTypeItemViewModel(
                new OutgoingsType
                {
                    ID = 2,
                    ParentID = 2,
                    Name = "生活用品"
                }));

            List.Add(new OutgoingsTypeItemViewModel(
                new OutgoingsType
                {
                    ID = 3,
                    ParentID = 3,
                    Name = "泡面"
                }));
        }

        #endregion

        #region 属性

        private OutgoingsTypeListViewModel list = new OutgoingsTypeListViewModel();

        /// <summary>
        /// 类型列表
        /// </summary>
        public OutgoingsTypeListViewModel List
        {
            get { return this.list; }
            set
            {
                if (this.list != value)
                {
                    this.list = value;
                    RaisePropertyChanged(() => this.List);
                }
            }
        }

        #endregion
    }
}
